package luanvan.app.foodnote;

import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.view.Window;

public class ShowSettingActivity extends PreferenceActivity implements OnSharedPreferenceChangeListener{

	@SuppressWarnings("deprecation")
	public void onCreate(Bundle savedInstanceState) {
		 	requestWindowFeature(Window.FEATURE_LEFT_ICON);
	        super.onCreate(savedInstanceState);
	        
	        addPreferencesFromResource(R.xml.preferences);
	        getWindow().setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, R.drawable.setting_tools);
	 }

	@Override
	public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
			String key) {
		/*if(key.equals("1")){
			setResult(101);
			
			finish();
		}*/
		setResult(101);
		
		if(key.equals("2")){
			setResult(102);
		}
		finish();
	}
	 
}
